package week12;

public class Student {
    private String studentId;
    private String name;
    private String major;
    private Double score;

    public Student() {
    }

    public Student(String studentId, String name, String major, Double score) {
        this.studentId = studentId;
        this.name = name;
        this.major = major;
        this.score = score;
    }

    public String getStudentId() {
        return studentId;
    }

    public void setStudentId(String studentId) {
        this.studentId = studentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "studentId='" + studentId + '\'' +
                ", name='" + name + '\'' +
                ", major='" + major + '\'' +
                ", score=" + score +
                '}';
    }
    public boolean equals(Object obj){
        if (obj instanceof Student){
            Student student=(Student) obj;
            return this.studentId.equals(student.studentId)&&this.name.equals(student.major)&&this.score!=null&&this.score.equals(student.score);
        }
        return false;

    }
}
